<template>
    <div style="min-height: 100vh;background:#f5f5f5">
        <van-tabs v-model="active">
            <van-tab title="已付款">
                <rebate-list :list="list" :isNone="isNone"></rebate-list>
            </van-tab>
            <van-tab title="待返利">
                <rebate-list :list="list" :isNone="isNone"></rebate-list>
            </van-tab>
            <van-tab title="已返利">
                <rebate-list :list="list" :isNone="isNone"></rebate-list>
            </van-tab>
            <van-tab title="已失效">
                <rebate-list :list="list" :isNone="isNone"></rebate-list>
            </van-tab>
        </van-tabs>
    </div>
</template>

<script>
    import request from "@/request/index.js"
    import rebateList from "@/components/notecase/rebateList.vue"
    export default {
        name: "rebate",
        components:{
            rebateList,
        },
        data(){
            return{
                list:[],
                page:1,
                isNone:false,
                active:0,
            }
        },
        watch:{
            active(newVal,oldVal){
                this.list=[];
                this.$router.push({
                    path:'rebate?type='+newVal,
                })
            },
            '$route'(to, from) {   
                this.active= this.$route.query.type  ;
                request.rebateOrder(this);
            }
        },
        methods:{
        },
        created(){

        },
        mounted(){
            this.active=this.$route.query.type
            request.rebateOrder(this)
        }
    }
</script>

<style scoped lang="scss">

</style>
